The maximum instruction length for both x86-32 and
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 11 Apr 2006 09:44:07 +0000 (10:44 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 11 Apr 2006 09:44:07 +0000 (10:44 +0100)
x86-64 is 15 bytes (including all prefixes, opcode,
ModRM, SIB, displacement, and immediate bytes).
This patch adjusts the MAX_INST_LEN to the correct
value.  This should reduce the size of some variables
in the hypervisor code.  This patch also does some
minor code clean-up in the vm exit handler for VMX.

Signed-off-by: Khoa Huynh <khoa@us.ibm.com>
xen/arch/x86/hvm/vmx/vmx.c
xen/include/asm-x86/hvm/io.h

index 5f7fa0221e53a8313f45260a0e7f406b14f54c37..059b188f91596a10f594739331e4f7481d74c20b 100644 (file)
@@ -1947,7 +1947,7 @@ static inline void vmx_vmexit_do_extint(struct cpu_user_regs *regs)
         && !(vector & INTR_INFO_VALID_MASK))
         __hvm_bug(regs);
 
-    vector &= 0xff;
+    vector &= INTR_INFO_VECTOR_MASK;
     local_irq_disable();
     TRACE_VMEXIT(1,vector);
 
@@ -2077,10 +2077,8 @@ asmlinkage void vmx_vmexit_handler(struct cpu_user_regs regs)
         return;
     }
 
-    {
-        __vmread(GUEST_RIP, &eip);
-        TRACE_VMEXIT(0,exit_reason);
-    }
+    __vmread(GUEST_RIP, &eip);
+    TRACE_VMEXIT(0,exit_reason);
 
     switch (exit_reason) {
     case EXIT_REASON_EXCEPTION_NMI:
@@ -2097,7 +2095,7 @@ asmlinkage void vmx_vmexit_handler(struct cpu_user_regs regs)
         if ((error = __vmread(VM_EXIT_INTR_INFO, &vector))
             || !(vector & INTR_INFO_VALID_MASK))
             __hvm_bug(&regs);
-        vector &= 0xff;
+        vector &= INTR_INFO_VECTOR_MASK;
 
         TRACE_VMEXIT(1,vector);
         perfc_incra(cause_vector, vector);
index b3159971020b900ecbdbca353399c4884dd87f86..0d4b36b0ad25b99c5f6d3f1d791b2b668364acb9 100644 (file)
@@ -77,7 +77,7 @@ struct instruction {
     __u32   flags;
 };
 
-#define MAX_INST_LEN      32
+#define MAX_INST_LEN      15 /* Maximum instruction length = 15 bytes */
 
 struct mmio_op {
     int                    flags;